home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 5992 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  937 b 

  1. Path: news.magg.net!news
  2. From: n4mwd@magg.net (Dennis Hawkins)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: How to check array lenght?
  5. Date: Thu, 22 Feb 1996 04:02:58 GMT
  6. Organization: M.A.G. Information Services (MAGG.NET)
  7. Message-ID: <4ggmfs$tg@dopey.magg.net>
  8. References: <4gbphl$ht@malakor.kku.ac.th> <Pine.A32.3.91.960221002504.156335H-100000@black.weeg.uiowa.edu>
  9. NNTP-Posting-Host: wpb-141.magg.net
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. The Amorphous Mass <robinson@blue.weeg.uiowa.edu> wrote:
  13.  
  14. >On 20 Feb 1996, terdthai tong-un wrote:
  15.  
  16. >> In subroutine that recieve pointer of array.
  17. >> How to check number of multidimention array in that routine?
  18.  
  19. >  You can't.  That information would have to be passed to the function 
  20. >via extra parameters or some other means.
  21.  
  22. Try using: 
  23.  
  24. #define numelem(array)   (sizeof(array) / sizeof(array[0]))
  25.  
  26. then pass the results as an extra parameter to your function.
  27.  
  28.  
  29. Dennis Hawkins
  30. n4mwd@amsat.org
  31.  
  32.